package com.woniu.his.pms.client;


import com.woniu.his.pms.client.param.AddPatientClientParam;
import com.woniu.his.pms.client.param.PhoneLoginParam;
import com.woniu.his.pms.client.result.PatientLoginResult;
import com.woniu.his.pms.client.result.PatientResult;
import com.woniu.his.pms.client.result.StartDiagnosePatientResult;
import com.woniu.his.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "PatientClient",name="pms",path="pms")
public interface PmsPatientClient {

    /**
     * 添加患者
     * @param param
     * @return
     */
    @PostMapping("addPatient")
    Result<PatientResult> addPatient(@RequestBody AddPatientClientParam param);

    /**
     * 查询患者
     * @param patientIds
     * @return
     */
    @GetMapping("queryPatient")
    Result<List<PatientResult>> queryPatient(@RequestParam("patientIds") List<Long> patientIds);

    /**
     * 根据身份证查询患者
     * @param identity
     * @return
     */
    @GetMapping("queryPatientByIdentity")
    Result<PatientResult> queryPatientByIdentity(@RequestParam("identity") String identity);

    /**
     * 开始诊断病人所需的病人信息
     * @param patientId
     * @return
     */
    @GetMapping("queryPatientById")
    Result<StartDiagnosePatientResult> queryPatientById(@RequestParam("patientId") Long patientId);


    /**
     * 病人手机登录
     *
     * @param param 参数
     * @return {@link Result}<{@link PatientLoginResult}>
     */
    @PostMapping("patientPhoneLogin")
    Result<PatientLoginResult> patientPhoneLogin(@RequestBody PhoneLoginParam param);

    @GetMapping("checkPatientIsExist")
    public Result checkPatientIsExist(@RequestParam("patientId") Long patientId);

}
